﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="test_6_1.aspx.cs" Inherits="Web_Project.test_6_1" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <style type="text/css">
        .auto-style1 {
            width: 452px;
        }
    </style>
    <script type="text/javascript">
        function confirmDelete() {
            return confirm("您确定要删除这个商品吗？\n此操作不可恢复！");
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <asp:Label ID="Label1" runat="server" Text="请输入分类名称："></asp:Label>
            <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
            <asp:Button ID="Button1" runat="server" Text="查询" OnClick="Button1_Click" />
            <br />
            <br />
            <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="True">
</asp:GridView>
            <br />
            <br />
            <asp:Label ID="fenlei_bianhao" runat="server" Text="分类编号："></asp:Label>
            <asp:DropDownList ID="D1" runat="server" AutoPostBack="True" OnSelectedIndexChanged="D1_SelectedIndexChanged">
            </asp:DropDownList>
            <br />
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:mfd_severConnectionString %>" InsertCommand="INSERT INTO [Category]([Name],[Descn]) VALUES(@Name,@Descn)" SelectCommand="SELECT * FROM [Category]">
                <InsertParameters>
                    <asp:ControlParameter ControlID="fenlei_mc_Tbox" Name="Name" PropertyName="Text" />
                    <asp:ControlParameter ControlID="Tbox_miaoshu" Name="Descn" PropertyName="Text" />
                </InsertParameters>
            </asp:SqlDataSource>
            <br />
            <asp:Label ID="fenlei_mingcheng" runat="server" Text="分类名称:"></asp:Label>
            <asp:TextBox ID="fenlei_mc_Tbox" runat="server"></asp:TextBox>
            <br />
            <asp:Label ID="Label3" runat="server" Text="描述:"></asp:Label>
            <asp:TextBox ID="Tbox_miaoshu" runat="server"></asp:TextBox>
            <br />
            <br />
            <asp:Button ID="tainjia" runat="server" Text="添加" OnClick="tainjia_Click" />
&nbsp;<asp:Button ID="xiugai" runat="server" Text="修改" OnClick="xiugai_Click" />
&nbsp;<asp:Button ID="shanchu" runat="server" Text="删除" OnClick="shanchu_Click1" />
            <br />
            <asp:Label ID="Label2" runat="server"></asp:Label>
            <br />
            <br />
            <br />
            <table>
                <tr>
                    <td>请选择商品：</td>
                    <td class="auto-style1">
                        <asp:DropDownList ID="D2" runat="server" AutoPostBack="True" OnSelectedIndexChanged="D2_SelectedIndexChanged">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td>分类：</td>
                    <td class="auto-style1">
                        <asp:DropDownList ID="D3" runat="server">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td>价格：</td>
                    <td class="auto-style1">
                        <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>单价：</td>
                    <td class="auto-style1">
                        <asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>供应商：</td>
                    <td class="auto-style1">
                        <asp:DropDownList ID="D4" runat="server">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td>商品名称：</td>
                    <td class="auto-style1">
                        <asp:TextBox ID="TextBox4" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>商品简介：</td>
                    <td class="auto-style1">
                        <asp:TextBox ID="TextBox5" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>图片:</td>
                    <td class="auto-style1">
                        <asp:Image ID="Image1" runat="server" />
                        <asp:FileUpload ID="FileUpload1" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td>数量：</td>
                    <td class="auto-style1">
                        <asp:TextBox ID="TextBox6" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <asp:Button ID="Button2" runat="server" Text="添加商品" OnClick="Button2_Click" />
&nbsp;<asp:Button ID="Button3" runat="server" Text="修改商品" OnClick="Button3_Click" />
&nbsp;<asp:Button ID="Button4" runat="server" Text="删除商品" OnClientClick="return confirmDelete();" OnClick="Button4_Click" />
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <asp:Label ID="Label4" runat="server"></asp:Label>
                    </td>
                </tr>
            </table>
            <br />
        </div>
    </form>
</body>
</html>
